package com.bulletelc.apollopre.utils;

import android.os.Environment;

import com.bulletelc.apollopre.R;
import com.bulletelc.apollopre.MyApplication;

import java.io.File;

/**
 * author: lhl
 * date  : 2017/11/04
 * desc  : 文件路径工具类，设定一些常用的文件路径
 */

public final class PathUtil {

    private PathUtil() {
        //empty
    }
    /**
     * 照片文件夹名
     */
    public static final String DIR_CAMERA = "Camera";
    /**
     * 外部存储公共的相机照片文件夹路径
     * eg: /storage/emulated/0/DCIM/Camera/
     */
    private static String externalPublicCameraDir;
    /**
     * 外部存储私有的相机照片文件夹路劲
     * eg : /storage/emulated/0/Android/data/com.bulletelc.apollopre/files/DCIM/Camera/
     */
    private static String externalPrivateCameraDir;
    /**
     * 内部存储私有的相机照片文件夹路劲
     * eg: /data/data/com.bulletelc.apollopre/files/DCIM/Camera/
     */
    private static String internalPrivateCameraDir;
    /**
     * 获取外部存储公共图库下存放项目图片的文件夹路径
     * eg:/storage/emulated/0/Pictures/爱家商城/
     */
    private static String externalPublicPictures;

    public static String getExternalPublicCameraDir() {
        externalPublicCameraDir =Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath() + File.separator + DIR_CAMERA+File.separator;
        return externalPublicCameraDir;
    }

    public static String getExternalPrivateCameraDir() {
        externalPrivateCameraDir = MyApplication.getInstance().getExternalFilesDir(Environment.DIRECTORY_DCIM).getAbsolutePath() + File.separator + DIR_CAMERA + File.separator;
        return externalPrivateCameraDir;
    }

    public static String getInternalPrivateCameraDir() {
        internalPrivateCameraDir = MyApplication.getInstance().getFilesDir().getAbsolutePath() + File.separator + Environment.DIRECTORY_DCIM + File.separator + DIR_CAMERA + File.separator;
        return internalPrivateCameraDir;
    }

    public static String getExternalPublicPictures() {
        externalPublicPictures = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getAbsolutePath() + File.separator + MyApplication.getInstance().getString(R.string.app_name)+File.separator;
        return externalPublicPictures;
    }
}
